//
//  MyHeaderView.m
//  BrushFace
//
//  Created by timer_q on 15/12/4.
//  Copyright © 2015年 Zzz. All rights reserved.
//

#import "MyHeaderView.h"
#import "NavHelper.h"
#import <UIButton+WebCache.h>
#import "MeStatus.h"

@implementation MyHeaderView
{
    __weak IBOutlet UILabel *nickNameLabel;
    __weak IBOutlet UILabel *phoneLabel;
    __weak IBOutlet UIImageView *backGroundImage;
    __weak IBOutlet UIButton *headerImageBtn;
    __weak IBOutlet UIImageView *image;
    
}
- (void)myViewSetName:(NSString *)name andPhoneNum:(NSString *)num{

//    if (name.length>2) {
//        name = [NSString stringWithFormat:@"**%@",[name substringWithRange:NSMakeRange(2, name.length-2)]];
//    }else{
//        name = [NSString stringWithFormat:@"**%@",[name substringWithRange:NSMakeRange(1, name.length-1)]];
//    }
    num = [NSString stringWithFormat:@"%@****%@",[num substringWithRange:NSMakeRange(0, 3)],[num substringWithRange:NSMakeRange(7, 4)]];
    if (name.isNotEmpty) {
        nickNameLabel.text = name;
    }else{
        nickNameLabel.text = @"未填写昵称";
    }
    phoneLabel.text = num;
    [image sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@%@",HEADERIMAGE_FETCH,[MeStatus sharedInstance].userId]]];
}
- (void)awakeFromNib{
    
}
-(void)layoutSubviews
{
    [super layoutSubviews];
    image.layer.cornerRadius = headerImageBtn.frame.size.width/2.0;
    image.clipsToBounds = YES;
}

- (IBAction)headerImageBtnClicked:(id)sender {
    
}
- (IBAction)userInfoButtonClick:(id)sender {
    [NavHelper gotoUserInfoVC];
    
}


@end
